<?php

/**
 * PersonalMemberDataVersion form base class.
 *
 * @method PersonalMemberDataVersion getObject() Returns the current form's model object
 *
 * @package    Wildlive
 * @subpackage form
 * @author     Maximilian Lenkeit <dev@lenki.com>
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasePersonalMemberDataVersionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                         => new sfWidgetFormInputHidden(),
      'member_id'                  => new sfWidgetFormInputText(),
      'bank_account_id'            => new sfWidgetFormInputText(),
      'email_address'              => new sfWidgetFormInputText(),
      'date_of_birth'              => new sfWidgetFormDate(),
      'birthplace'                 => new sfWidgetFormInputText(),
      'direct_debit_authorization' => new sfWidgetFormInputCheckbox(),
      'created_at'                 => new sfWidgetFormInputText(),
      'updated_at'                 => new sfWidgetFormInputText(),
      'deleted_at'                 => new sfWidgetFormInputText(),
      'created_by'                 => new sfWidgetFormInputText(),
      'updated_by'                 => new sfWidgetFormInputText(),
      'deleted_by'                 => new sfWidgetFormInputText(),
      'version'                    => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'                         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'member_id'                  => new sfValidatorInteger(array('required' => false)),
      'bank_account_id'            => new sfValidatorInteger(array('required' => false)),
      'email_address'              => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'date_of_birth'              => new sfValidatorDate(array('required' => false)),
      'birthplace'                 => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'direct_debit_authorization' => new sfValidatorBoolean(array('required' => false)),
      'created_at'                 => new sfValidatorPass(array('required' => false)),
      'updated_at'                 => new sfValidatorPass(array('required' => false)),
      'deleted_at'                 => new sfValidatorPass(array('required' => false)),
      'created_by'                 => new sfValidatorInteger(array('required' => false)),
      'updated_by'                 => new sfValidatorInteger(array('required' => false)),
      'deleted_by'                 => new sfValidatorInteger(array('required' => false)),
      'version'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('version')), 'empty_value' => $this->getObject()->get('version'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('personal_member_data_version[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'PersonalMemberDataVersion';
  }

}
